# Maintainer: Alexander Epaneshnikov <alex19ep@archlinux.org>
# Contributor: ny-a <nyaarch64 at gmail dot com>
# Contributor: Cristian Delgado <cristdelc at gmail dot com>
# Contributor: Andrew Sun <adsun701 at gmail dot com>
# Contributor: Dmitrij D. Czarkoff <czarkoff at gmail dot com>

pkgname=libre
pkgver=2.10.0
pkgrel=1
pkgdesc="Portable library for real-time communications"
arch=('loong64' 'x86_64')
url="https://github.com/baresip/re"
license=('BSD')
depends=('openssl' 'zlib')
replaces=('re')
conflicts=('re')
provides=(libre.so)
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/baresip/re/archive/v${pkgver}.tar.gz"
        "re-flags.patch")
sha256sums=('4d2b6f8fc73efdbcb5a7b2a98d0b46ac6eb28ede5ae90f9596b49663eec623a9'
            'd269af3a87305cef303069cc1287be0b504c2bcf48160866fa05e7951d38f2f7')

prepare() {
  cd re-${pkgver}
  patch -Np1 -i "${srcdir}/re-flags.patch"
}

build() {
  cd re-${pkgver}
  make RELEASE=1
}

package() {
  cd re-${pkgver}
  make RELEASE=1 DESTDIR="${pkgdir}" install
  install -vDm644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
}
